<?php

session_start();


require "include/template2.inc.php";
require "include/beContent.inc.php";

require "include/auth.inc.php";

$main = new Skin(); 

$form = new Form("dataEntry",$projectEntity);

$form->addSection("Project Type Management");

$form->addText("name", "Name", 80, MANDATORY);
$form->addText("acronym", "Acronym", 80, MANDATORY);
$form->addSelectFromReference2($pType, "type", "Type", MANDATORY);
$form->addDate("date_begin", "Begin", MANDATORY);
$form->addDate("date_end", "End", MANDATORY);
$form->addEditor("des", "Description", 10, 50);
$form->addFile("logo", "Logo");
$form->addText("link", "Link", 60);

$form_2 = new Form("data2", $pUsers);
$form_2->addRelationManager("rel", "Participants");
#$form_2->restrictReference("rel", "project_users.username = 'alfonso'");

$form->triggers($form_2);

if (!isset($_REQUEST['action'])) {
	$_REQUEST['action'] = "edit";
}
switch($_REQUEST['action']) {
	case "add":
	$main->setContent("body",$form->addItem());
	break;
	case "edit":
	$main->setContent("body",$form->editItem());
	break;
}

$main->close();

?> 